package gui.gui2d.highLevelPanels;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.Random;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

import utility.PieceImage;
import world.pieces.Rook;

public class PlayerEatenListPanel extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	GridBagConstraints c;
	int tot=0;
	int insertInx=0;
	int insertIny=7;

	public PlayerEatenListPanel() {
		this.setLayout(new GridBagLayout());
		this.setOpaque(false);
		c = new GridBagConstraints();
		c.weighty =1;
		c.ipady =0; 
		c.ipadx = 0;  
	}
	
	public void putPiece(PieceImage pi){
		if(tot>15){
			return;
		}
		tot++;
		c.gridx = insertInx;
		c.gridy = insertIny;
		this.add(pi,c);		
		insertInx++;
		if(insertInx>1){
			insertInx=0;
			insertIny--;
		}
	}
}
